The invention relates to an image processing apparatus, in particular to those capable of three-dimensional image rendering.
In three-dimensional image processing, normal vectors of polygons are derived by dividing a three-dimensional model of an object into multiple polygons. At the same time, a two-dimensional texture image is effectively affixed to the polygon surface by texture mapping of the two-dimensional texture image, where texture modification is possible as well as ordinary two-dimensional image modification, but the modification of a three-dimensional model is extremely difficult. Moreover, modeling of fine convexity and concavity of a three-dimensional model surface is also difficult. Therefore, a bump mapping technique has been proposed so as to notionally modulate convexity and concavity of the surface of an object by mapping a bump image which shows a modulation direction of a normal vector onto the surface of a three-dimensional object.
In bump image modification, it is necessary to imagine a display image obtained by rendering after mapping a bump image to an object surface to modulate the normal direction thereof. After the bump image is modified to some extent, the modified bump image is mapped again to the surface of a three-dimensional object and rendered again, and the modification result is then confirmed by seeing the display image. If any desirable modification has not been achieved, the bump image will be modified again. Accordingly, bump image modification would have to be repeated over again.
One object of the invention is to modify a bump image interactively with usage of a rendered image after mapping a bump image to an object so that the convexity and concavity are more easily represented and the modification result of the bump image is reflected on the display image with real time remapping and re-rendering.
It is an another object of the invention to facilitate the reverse mapping of the rendered display image to a texture image and a bump image so that more interactive bump image modification is achieved.
It is yet another object of the invention to modify a texture image and a bump image by the same processing system.
It is still yet another object of the invention to perform reverse mapping to a texture image and a bump image according to a common reverse mapping address system.
The present invention provides an image processing apparatus for mapping a two-dimensional texture image to a three-dimensional model of an object for displaying images by rendering. The processing apparatus includes:
bump memory for storing a bump image of said three-dimensional model;
modulation means for modulating the normal direction of said three-dimensional model according to the bump image:
mapping means for mapping said two-dimensional texture image onto the three-dimensional model with its normal direction modulated;
rendering means for obtaining and displaying a display image by rendering the three-dimensional model on which the two-dimensional texture image is mapped; and
drawing means for specifying a position in said rendered image and modifying the bump image at the address in the bump memory corresponding to said specified position.
Here the texture image is a two-dimensional image showing the tint, shade, patterns and others of the object surface, and the bump image is, for example, a two-dimensional image for modulating the normal direction of a three-dimensional model of an object. And, in this specification, mapping is mapping of a texture image and a bump image to the surface of a three-dimensional object, and reverse mapping is mapping of a rendering image to a texture image and a bump image, and rendering is conversion of a three-dimensional image to a two-dimensional image in accordance with how an object looks from a view point. In one embodiment of the invention, the rendering means comprises a phong shading processor, a hidden surface processor, a rendering memory and a monitor.
Preferably, a rendering memory is provided for storing the display image obtained by rendering, whereby a reverse mapping address for reverse mapping of the display image to one of the texture image and the bump image is stored in said rendering memory.
Preferably, said drawing means for modification is selectively provided with one of said two-dimensional texture image and said bump image.
Preferably, means for obtaining normal vectors in two planes in regard to each position of said bump image and a reference table for obtaining a normal direction based upon the obtained two normal vectors are provided.
Preferably, the texture and the bump image are scaled, and they are stored in a common coordinate system.
According to the invention, the bump image of a three-dimensional model is stored in a bump memory for modifying the bump image interactively in the rendering process. If the bump image is modified, the normal direction of the surface in the three-dimensional model is modulated. The bump image after the modification is mapped to the object in real time, and the object to which a texture image is mapped is re-rendered for the display, therefore, the bump image is modified in real time with the convex and concave representation being modified. The bump image may be an image by each model or an image including a plurality of models.
Preferably, a reverse mapping address is stored in the rendering memory for the reverse mapping from the rendering image to one of the texture image and the bump image. Therefore, when the address for reverse mapping is read out from the rendering memory, the drawing address to the texture image or the bump image is obtained instantly, and the texture image or the bump image is modified in real time.
Preferably, one of the texture image and the bump image is provided to the common drawing means for modification. That is to say, texture image drawing, as well as bump image drawing, can be processed by the common drawing means.
Preferably, the normal vectors of the modulation direction of the object surface are derived from the bump image in regard to two planes, such as X-Z and Y-Z, and the normal direction of the bump image is obtained from the reference table according to the normal vectors. In this way, the normal direction is obtained without the outer product operation with high speed processing.
Preferably, the texture image and the bump image are scaled and stored in a common coordinate system. Accordingly, reverse mapping to both the texture image and the bump image is achieved by the same reverse mapping address.